package com.qianxx.component.activity.list.pull_down_list_view;

import android.os.Bundle;
import android.widget.ArrayAdapter;

import com.qianxx.component.R;
import com.qianxx.component.activity.base.BaseActivity;
import com.qianxx.viewlibrary.list.pulldownlistview.PullDownListView;

import butterknife.BindView;
import butterknife.ButterKnife;

public class PullDownListViewActivity extends BaseActivity {
    @BindView(R.id.pull_down_list_view)
    PullDownListView pull_down_list_view;
    String[] list = new String[] { "雪铁龙", "奥迪", "宝马",
        "阿斯顿马丁", "保时捷", "雷克萨斯", "兰博基尼", "奔驰",
        "劳斯莱斯", "英菲尼迪", "宾利", "捷豹" };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pull_down_list_view);
        ButterKnife.bind(this);

        initView();
    }

    private void initView() {
        pull_down_list_view.setAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, list));
        pull_down_list_view
                .setOnPullHeightChangeListener(new PullDownListView.OnPullHeightChangeListener() {

                    @Override
                    public void onTopHeightChange(int headerHeight,
                                                  int pullHeight) {

                    }

                    @Override
                    public void onBottomHeightChange(int footerHeight,
                                                     int pullHeight) {

                    }

                    @Override
                    public void onRefreshing(final boolean isTop) {

                    }

                });

    }

    @Override
    public String setTitle() {
        return "PullDownListView";
    }
}
